info :	
	@echo "make one TEST=test"
	@echo " - where test is one of $(TESTS)"
	@echo "make all"
	@echo "make run"

-include ../../../../Make.inc

PIV   = PIV
PIVS  = NOPIV PIV INCPIV

TEST  = lu
TESTS = ldl lu chol


##CXX = mpicxx
CXX_WORK 	= $(CXX) $(CFLAGS) -D $(PIV) $(EXTRA_CFLAGS) \
		  $(CCDEBUG) $(CCWARN) 

LIBS            = $(UHM_LINK_LIBS)


%_$(PIV).o : %.cxx
	@echo "Compiling $<"
	$(CXX_WORK) $(CCINCS) -o $@ -c $<

one : $(TEST)_$(PIV).o
	@echo "Linking   $<"
	$(CXX_WORK) -o $(TEST)_$(PIV) $(TEST)_$(PIV).o  $(LIBS)  $(LDFLAGS)

all :
	for p in $(PIVS) ; do \
	for e in $(TESTS) ; do \
		make one TEST=$$e PIV=$$p; \
	done; done
run : 
	./$(TEST)_$(PIV)

clean :
	@/bin/rm -f *.o *~ test.log
	@/bin/rm -rf ./ooc_dir
	@for p in $(PIVS) ; do \
	for e in $(TESTS) ; do \
		rm -f "$$e"_"$$p"; \
	done; done
